'use strict';

const Controller = require('egg').Controller;
const axios = require('axios');
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.transformRequest = [ function(data) {
  let ret = '';
  for (const it in data) {
    if (typeof data[it] === 'object') {
      ret += encodeURIComponent(it) + '=' + encodeURIComponent(JSON.stringify(data[it])) + '&';
    } else {
      ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
    }
  }
  return ret;
} ];

const data = {
  act: null,
  action: '',
  code: '0000',
  data: {
    brandList: [{
      propertyId: 15178,
      propertyName: '缤纷田园',
    }, {
      propertyId: 1433,
      propertyName: '其它',
    }, {
      propertyId: 767,
      propertyName: '白玉',
    }, {
      propertyId: 13,
      propertyName: '佳沛',
    }, {
      propertyId: 1451,
      propertyName: '方圆平安',
    }, {
      propertyId: 20665,
      propertyName: '聚启蔬菜',
    }, {
      propertyId: 2779,
      propertyName: '良食记',
    }, {
      propertyId: 806,
      propertyName: '亲民',
    }, {
      propertyId: 821,
      propertyName: '维理',
    }],
    pageInfo: {
      pageCount: 8,
      pageNum: 1,
      pageSize: 20,
      total: 144,
    },
    properties: [{
      childProperties: [{
        propertyId: 15178,
        propertyName: '缤纷田园',
      }, {
        propertyId: 1433,
        propertyName: '其它',
      }, {
        propertyId: 767,
        propertyName: '白玉',
      }, {
        propertyId: 13,
        propertyName: '佳沛',
      }, {
        propertyId: 1451,
        propertyName: '方圆平安',
      }, {
        propertyId: 20665,
        propertyName: '聚启蔬菜',
      }, {
        propertyId: 2779,
        propertyName: '良食记',
      }, {
        propertyId: 806,
        propertyName: '亲民',
      }, {
        propertyId: 821,
        propertyName: '维理',
      }],
      propertyId: -1,
      propertyName: '品牌',
    }],
    style: [{
      imgPath: '',
      label: '[预售]',
      sourceId: '1',
      type: 1,
    }],
    wareList: [{
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量6.1万件',
      offlinePrice: 1689,
      onlinePrice: 1689,
      onlinePromotionPrice: 1690,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 1690,
        origPrice: 1690,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100460304,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 1690,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100460304',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10439420',
      wareImg: 'https://img.dmallcdn.com/20200304/66c2d76e-c1a6-4b13-aade-336096bc9d1d_240x240H',
      wareName: '缤纷田园不知火丑柑 约1kg',
      warePrice: '1690',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H', 'https://img.dmallcdn.com/cornerMarkV3/1112/1_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量8.9万件',
      offlinePrice: 190,
      onlinePrice: 190,
      onlinePromotionPrice: 190,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 190,
        origPrice: 190,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100822797,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 190,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100822797',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10800748',
      wareImg: 'https://img.dmallcdn.com/20180906/b9284d9a-91c7-413d-8e9a-4e4c3dc70f84_240x240H',
      wareName: '每日鲜小白菜【袋】 约300g',
      warePrice: '190',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量5.6万件',
      offlinePrice: 590,
      onlinePrice: 590,
      onlinePromotionPrice: 590,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 590,
        origPrice: 590,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100276383,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 590,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100276383',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10277450',
      wareImg: 'https://img.dmallcdn.com/20180615/f1d59f5d-3072-438a-ad57-ad316e8733f2_240x240H',
      wareName: '娃娃菜【精】 约500g 新老包装随机',
      warePrice: '590',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量1.1万件',
      offlinePrice: 1689,
      onlinePrice: 1689,
      onlinePromotionPrice: 1690,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 1690,
        origPrice: 1690,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100328923,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 1690,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100328923',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10308402',
      wareImg: 'https://img.dmallcdn.com/20180704/db0d2d6e-c86b-4407-8c30-b2dd23eb6f2e_240x240H',
      wareName: '缤纷田园栖霞红富士6粒  约1kg',
      warePrice: '1690',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量2.8万件',
      offlinePrice: 690,
      onlinePrice: 690,
      onlinePromotionPrice: 690,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 690,
        origPrice: 690,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100336828,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 690,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100336828',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10316307',
      wareImg: 'https://img.dmallcdn.com/20191203/cb985d25-3bff-4490-9ac9-45214af2a254_240x240H',
      wareName: '越南白心火龙果（精） 约420g',
      warePrice: '690',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量11万件',
      offlinePrice: 490,
      onlinePrice: 490,
      onlinePromotionPrice: 490,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 490,
        origPrice: 490,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 191291,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 490,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '191291',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '191017',
      wareImg: 'https://img.dmallcdn.com/20200116/3d12b606-6773-4dc8-aa88-6604d40902ef_240x240H',
      wareName: '黄瓜【精】 约600g',
      warePrice: '490',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量3.1万件',
      offlinePrice: 550,
      onlinePrice: 550,
      onlinePromotionPrice: 550,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 550,
        origPrice: 550,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100710115,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 550,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100710115',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10688537',
      wareImg: 'https://img.dmallcdn.com/20181217/fe1a1428-ee9d-4022-9350-235e671fafa6_240x240H',
      wareName: '姜【精】 约350g',
      warePrice: '550',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H', 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量5.0万件',
      offlinePrice: 490,
      onlinePrice: 490,
      onlinePromotionPrice: 490,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 490,
        origPrice: 490,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 191316,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 490,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '191316',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '191042',
      wareImg: 'https://img.dmallcdn.com/20180906/ed5a3f4e-8caa-4b76-b3b2-3cf636d03aa0_240x240H',
      wareName: '缤纷田园香菇 约250g',
      warePrice: '490',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量2.1万件',
      offlinePrice: 350,
      onlinePrice: 350,
      onlinePromotionPrice: 350,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 350,
        origPrice: 350,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100460324,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 350,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100460324',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10439440',
      wareImg: 'https://img.dmallcdn.com/20180315/ae1bce01-dfc0-40fb-b385-3d6229b0a9d6_240x240H',
      wareName: '青梗散菜花【盒】 约300g',
      warePrice: '350',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量4.2万件',
      offlinePrice: 676,
      onlinePrice: 796,
      onlinePromotionPrice: 796,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 676,
        origPrice: 796,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 101635790,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 796,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '101635790',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '11586141',
      wareImg: 'https://img.dmallcdn.com/20200424/92efe1ac-c8ff-402f-a07e-5feced59f706_240x240H',
      wareName: '缤纷田园西红柿家庭装 1kg',
      warePrice: '796',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量2.4万件',
      offlinePrice: 490,
      onlinePrice: 490,
      onlinePromotionPrice: 490,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 490,
        origPrice: 490,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100239353,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 490,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100239353',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10239987',
      wareImg: 'https://img.dmallcdn.com/20180611/3223e1bf-93a2-4891-80cd-dc0500beec2d_240x240H',
      wareName: '圆茄子【精】 约300g',
      warePrice: '490',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/1112/1_240x240H', 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量13万件',
      offlinePrice: 390,
      onlinePrice: 390,
      onlinePromotionPrice: 390,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 390,
        origPrice: 390,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100822808,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 390,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100822808',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10800759',
      wareImg: 'https://img.dmallcdn.com/20180911/a2f8495b-570a-4a37-ae25-daac95d38c2b_240x240H',
      wareName: '每日鲜菠菜【袋】 约250g',
      warePrice: '390',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H', 'https://img.dmallcdn.com/cornerMarkV3/1112/1_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量5.8万件',
      offlinePrice: 190,
      onlinePrice: 190,
      onlinePromotionPrice: 190,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 190,
        origPrice: 190,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100697888,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 190,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100697888',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10676312',
      wareImg: 'https://img.dmallcdn.com/20191203/ecf50868-be15-43db-a4ab-c17211337c03_240x240H',
      wareName: '每日鲜黄豆芽【精】 约350g',
      warePrice: '190',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量11万件',
      offlinePrice: 590,
      onlinePrice: 590,
      onlinePromotionPrice: 590,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 590,
        origPrice: 590,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100198262,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 590,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100198262',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10198354',
      wareImg: 'https://img.dmallcdn.com/20200116/e149e106-34eb-45a3-904e-95fc800895ee_240x240H',
      wareName: '新土豆【精】 约1kg',
      warePrice: '590',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量3.0万件',
      offlinePrice: 790,
      onlinePrice: 490,
      onlinePromotionPrice: 490,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 790,
        origPrice: 490,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: true,
        skuId: 191290,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 490,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '191290',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '191016',
      wareImg: 'https://img.dmallcdn.com/20190725/b28f49c0-d47c-4b67-b2f0-6afb08809990_240x240H',
      wareName: '扁豆【精】 约350g',
      warePrice: '490',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/1112/1_240x240H', 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量2.1万件',
      offlinePrice: 390,
      onlinePrice: 390,
      onlinePromotionPrice: 390,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 390,
        origPrice: 390,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100822812,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 390,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100822812',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10800763',
      wareImg: 'https://img.dmallcdn.com/20190226/cec0d055-bb8f-43d6-af26-b583efec60ff_240x240H',
      wareName: '每日鲜蒿子秆【袋】 约250g',
      warePrice: '390',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量2.9万件',
      offlinePrice: 790,
      onlinePrice: 790,
      onlinePromotionPrice: 790,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 790,
        origPrice: 790,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100329242,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 790,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100329242',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10308721',
      wareImg: 'https://img.dmallcdn.com/20190404/6ce0dc9b-e53a-4463-a1db-5de90ed21d26_240x240H',
      wareName: '蒜头【精】 约400g',
      warePrice: '790',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量7.6万件',
      offlinePrice: 380,
      onlinePrice: 380,
      onlinePromotionPrice: 380,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 380,
        origPrice: 380,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 191288,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 380,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '191288',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '191014',
      wareImg: 'https://img.dmallcdn.com/20180906/16110980-1f1c-40fc-8b54-88a379047b2a_240x240H',
      wareName: '缤纷田园胡萝卜 约450g',
      warePrice: '380',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量2.2万件',
      offlinePrice: 1590,
      onlinePrice: 1590,
      onlinePromotionPrice: 1590,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 1590,
        origPrice: 1590,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100346738,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 1590,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100346738',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10326217',
      wareImg: 'https://img.dmallcdn.com/20200310/b867e34b-614a-4880-bf66-751aad679157_240x240H',
      wareName: '缤纷田园进口红提 约500g/盒',
      warePrice: '1590',
      wareStatus: 0,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }, {
      cgbSkuType: null,
      collageTagPreSell: false,
      cornerMarkImgList: [ 'https://img.dmallcdn.com/cornerMarkV3/695/2_240x240H' ],
      cornerSign: [],
      mainSecondCmCat: null,
      monthSales: '月销量5.1万件',
      offlinePrice: 390,
      onlinePrice: 390,
      onlinePromotionPrice: 390,
      popVenderStoreLink: '',
      popVenderStoreName: '',
      priceDisplay: '',
      promoting: 'false',
      promotionWare: null,
      promotionWareVO: {
        isMatchSimplePro: false,
        marketPrice: 390,
        origPrice: 390,
        priceCalcProId: null,
        promotionInfoList: [],
        promotionInfoListUp: [],
        showLinePrice: false,
        skuId: 100327589,
        skuName: '',
        skuType: null,
        storeId: null,
        unitProPrice: 390,
        venderId: null,
      },
      resultData: null,
      resultType: 1,
      score: null,
      searchAdvertisement: null,
      searchRecTitle: '',
      sell: true,
      sku: '100327589',
      skuTagDataList: [],
      status: '1',
      storeId: 206,
      suitPromotionWareVO: null,
      tagPreSell: false,
      venderId: 1,
      venderType: null,
      wareDetailImgList: [],
      wareId: '10307068',
      wareImg: 'https://img.dmallcdn.com/20180917/5c3caace-8aeb-4457-a06d-fd0df1bca77b_240x240H',
      wareName: '大葱【精】 约500g',
      warePrice: '390',
      wareStatus: 3,
      wareType: null,
      wareTypeDescr: '',
      wareTypeForBS: null,
    }],
  },
  gatewayCache: '',
  gatewayUUID: null,
  msg: '成功！',
  result: '成功！',
};

class ProductController extends Controller {
  async list() {
    const { ctx } = this;
    const {
      page,
      page_size,
      ...where
    } = ctx.request.query;
    const list = await ctx.service.product.list({
      where,
      page_size,
      page,
    });
    ctx.body = {
      code: 1,
      data: list,
    };
  }

  async create() {
    const { ctx } = this;
    await ctx.service.product.inster(data.data.wareList);
    ctx.body = {
      msg: '成功',
    };
  }

  async classify() {
    const { ctx } = this;
    const data = await ctx.service.product.classify();
    ctx.body = {
      code: 1,
      data,
    };
  }

  async serarchKey() {
    // const formdata = {
    //   param: {
    //     globalSelection: false,
    //     keyword: this.ctx.request.query.keyword,
    //     venderId: 1,
    //     storeId: 206,
    //     businessCode: 1,
    //   },
    //   source: 2,
    //   tempid: 'C8CEE54E6D700002F898E250109E13E8',
    // };

    const formdata = {
      param: {
        globalSelection: false,
        keyword: this.ctx.request.query.keyword,
        venderId: '1',
        storeId: '206',
        businessCode: 1,
      },
      source: 2,
      tempid: 'C8CEE54E6D700002F898E250109E13E8',
    };

    const data = await axios.post('https://searchgw.dmall.com/miniprograms/search/searchSuggestions', formdata);
    console.log(data.data);
    this.ctx.body = data.data;
  }
}

module.exports = ProductController;
